package cn.itcast.crm.service;

import java.util.List;

import javax.ws.rs.Consumes;
import javax.ws.rs.GET;
import javax.ws.rs.POST;
import javax.ws.rs.PUT;
import javax.ws.rs.Path;
import javax.ws.rs.PathParam;
import javax.ws.rs.Produces;
import javax.ws.rs.QueryParam;

import cn.itcast.crm.domain.Customer;

public interface CustomerService {
	// 查询所有没有关联定区的客户
	@Path("/noAssociationCustomers")
	@GET
	@Produces({ "application/xml", "application/json" })
	public List<Customer> findNoAssociationCustomers();

	// 查询关联指定定区的客户
	@Path("/hasAssociationFixedAreaCustomers/{fixedAreaId}")
	@GET
	@Produces({ "application/xml", "application/json" })
	public List<Customer> findHasAssociationFixedAreaCustomers(@PathParam("fixedAreaId") String fixedAreaId);

	// 将指定客户关联到指定的定区
	@Path("/associationCustomersToFixedArea")
	@PUT
	public void associationCustomersToFixedArea(@QueryParam("customerIdStr") String customerIdStr,
			@QueryParam("fixedAreaId") String fixedAreaId);

	// 前端注册保存客户
	@Path("/regist")
	@POST
	@Consumes({ "application/xml", "application/json" })
	public void regist(Customer customer);

	// 根据手机号查找自定客户
	@Path("/regist/findByTelephone/{telephone}")
	@GET
	@Produces({ "application/xml", "application/json" })
	public Customer findByTelephone(@PathParam("telephone") String telephone);

	// 根据手机号修改客户的激活状态
	@Path("/regist/updateType/{telephone}")
	@PUT
	public void updateType(@PathParam("telephone") String telephone);

	// 根据手机号和密码查找用户
	@Path("/login")
	@GET
	@Produces({ "application/xml", "application/json" })
	public Customer findByTelephoneAndPassword(@QueryParam("telephone") String telephone,
			@QueryParam("password") String password);

	// 根据寄件地址匹配用户地址找到fixedId
	@Path("/findFixedAreaIdBySendAddress")
	@GET
	@Produces({ "application/xml", "application/json" })
	public String findFixedAreaIdBySendAddress(@QueryParam("sendAddress") String sendAddress);
}
